package com.easybuilder.core.im.service.impl;

import com.easybuilder.core.im.dao.SysMessageDao;
import com.easybuilder.core.im.entity.SysMessage;
import com.easybuilder.core.im.service.SysMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ZXS
 * @version 1.0
 * @description 消息服务
 * @date 2022-3-24 22:57
 */
@Slf4j
@Component
public class SysMessageServiceImpl implements SysMessageService {

    @Resource
    private SysMessageDao messageDao;

    /** 新增消息记录 */
    @Override
    public int insertSelective(SysMessage sysMessage) {
       return messageDao.insertSelective(sysMessage);
    }

    /** 更新消息记录 */
    @Override
    public int updateSelective(SysMessage sysMessage) {
        return messageDao.updateByPrimaryKeySelective(sysMessage);
    }

    @Override
    public int updateByExampleSelective(SysMessage sysMessage, Object obj) {
        return messageDao.updateByExampleSelective(sysMessage, obj);
    }

    /** 查询消息记录 */
    @Override
    public List<SysMessage> selectByExample(Example example) {
        if (example != null) {
            return messageDao.selectByExample(example);
        }
        return null;
    }


}
